package Account

import (
	"crypto/ecdsa"
	"Identity/common"
)

/*  =========== 身份账户 ========== */

type IdentityAccount struct {
	FaceInfo []byte

	Address []byte
	LoveTokens []*LoveToken
}

func (this * IdentityAccount)GetAddress() []byte {
	return this.Address
}

func (this * IdentityAccount)LoveTokenList() []*LoveToken{
	return this.LoveTokens
}

func (this * IdentityAccount)CreateNewLoveToken(msg  []byte, aAddr, bAddr common.Address ,starttime ,endtime uint64,w *Wallet){
	//1. 创建 lovetoken
	newLoveToken := NewLoveToken(msg, aAddr, bAddr,starttime ,endtime)

	//2. 计算digestHash
	newLoveToken.setDigestHash()

	//3. A进行签名
	newLoveToken.ASign(this.GetMyPrivateKey(w))

	//4. 提交到AsignedPool

}

//之后要将Wallet存放成文件
func (this * IdentityAccount)GetMyPrivateKey(w * Wallet) *ecdsa.PrivateKey{
	return  &w.PrivateKey
}


// 创建交易
func (this * IdentityAccount)CreateTokenTx() {

}

func (this * IdentityAccount)ApproveTokenTx(){

}


// 提交交易
func (this * IdentityAccount)CommitTx(){}

